using System.Collections;
using System.Collections.Generic;
using QFramework;
using UnityEngine;

namespace AsterroidX
{
    public class SetPauseCmd : AbstractCommand
    {

        private bool mPaused;

        public SetPauseCmd(bool paused)
        {
            mPaused = paused;
        }
        protected override void OnExecute()
        {
            var gameModel=this.GetModel<GameModel>();
            if(mPaused)
                Time.timeScale = 0;
            else
                Time.timeScale = 1;

                gameModel.Paused.Value = mPaused;
        }
    }
}
